package son.nt.act4;

import son.nt.R;
import android.app.Activity;
import android.os.Bundle;
import android.test.PerformanceTestCase;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;

public class DrawableResourceActivity extends Activity{
	ImageView imgRotate;
	ImageView imgScale;
	EditText txtLevel ;
	int iRotate = 0;
	Button btnRotate;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.act4_drawable);
		imgRotate = (ImageView) findViewById(R.id.imgRotate);
		txtLevel = (EditText) findViewById(R.id.txtRotate);
		btnRotate = (Button) findViewById(R.id.btnRotate);
		imgScale = (ImageView) findViewById(R.id.imgScale);
	}
	
	public void btnOnClick(View v){
		switch (v.getId()) {
		case R.id.btnRotate:
			String sLevel = txtLevel.getText().toString().trim();
			int iLevel = Integer.valueOf(sLevel);
			iRotate += 1000;
//			int i = 20;
//			while(i < 10000){
//				imgRotate.setImageLevel(i);
//				i += 150;
//			}
			imgRotate.setImageLevel(iRotate);
//			imgRotate.setImageLevel(iLevel);
//			imgScale.setImageAlpha(iLevel);
			break;

		default:
			break;
		}
	}
}
